import { Component, OnInit } from '@angular/core';
import {MyserviceService} from './service/myservice.service';

@Component({
  selector: 'app-test',
  templateUrl: './test.component.html',
  styleUrls: ['./test.component.css']
})
export class TestComponent implements OnInit {

  constructor(private myservice: MyserviceService) {
    this.myService = myservice;
  }
  title = 'Angular 6 Project!';
  // declared array of months.
  months = ["January", "Feburary", "March", "April", "May",
    "June", "July", "August", "September",
    "October", "November", "December"];
  isavailable=false;
  todaydate;
  jsonval = {name:'Rox', age:'25', address:{a1:'Mumbai', a2:'Karnataka'}};
  myService;
  myClickFunction(event) {
    //just added console.log which will display the event details in browser on click of the button.
    // alert("Button is clicked");
    console.log(event);
    this.isavailable = !this.isavailable;
  }
  changemonths(event){
    console.log("Changed month from the Dropdown");
    console.log(event);
  }
  ngOnInit() {
    this.todaydate = this.myService.showTodayDate()
  }
}
